<?php
$this->breadcrumbs=array(
	'Users'=>array('index'),
	'Manage',
);

$this->menu=array(
	array('label'=>'List Users', 'url'=>array('index')),
	array('label'=>'Create Users', 'url'=>array('create')),
);

Yii::app()->clientScript->registerScript('search', "
$('.search-button').click(function(){
	$('.search-form').toggle();
	return false;
});
$('.search-form form').submit(function(){
	$.fn.yiiGridView.update('users-grid', {
		data: $(this).serialize()
	});
	return false;
});
");
?>

<h1>Manage Users</h1>

<!-- <p>
You may optionally enter a comparison operator (<b>&lt;</b>, <b>&lt;=</b>, <b>&gt;</b>, <b>&gt;=</b>, <b>&lt;&gt;</b>
or <b>=</b>) at the beginning of each of your search values to specify how the comparison should be done.
</p>  -->

<?php //echo CHtml::link('Advanced Search','#',array('class'=>'search-button')); ?>
<div class="search-form" style="display:none">
<?php $this->renderPartial('_search',array(
	'model'=>$model,
)); ?>
</div><!-- search-form -->

<?php $this->widget('zii.widgets.grid.CGridView', array(
	'id'=>'users-grid',
	'dataProvider'=>$model->search(),
	'filter'=>$model,
	'columns'=>array(
		array('name'=>'id','filter'=>false,'htmlOptions'=>array('width'=>'10')),
		array('name'=>'username','filter'=>false,'htmlOptions'=>array('width'=>'50')),
		array('name'=>'movie_mode','filter'=>false,'htmlOptions'=>array('width'=>'20')),
    array('name'=>'total_points','filter'=>false,'htmlOptions'=>array('width'=>'10')),
     array('name'=>'status','filter'=>false,'htmlOptions'=>array('width'=>'10')),
		 array('name'=>'current_batch','filter'=>false,'htmlOptions'=>array('width'=>'10')),
		 array('name'=>'org_id','filter'=>false,'htmlOptions'=>array('width'=>'10')), 
		 array('name'=>'current_grade','filter'=>false,'htmlOptions'=>array('width'=>'10')), 
		 array('name'=>'activation_code','filter'=>false,'htmlOptions'=>array('width'=>'10')), 
		/*

		'current_url',
		'created',
		'modified',
		*/
		array(
			'class'=>'CButtonColumn',
			'template' => '{change_password}',
				'buttons'=>array(
                        'change_password' => array(
                                'label'=>'Change Password', // text label of the button
                                'url'=>"CHtml::normalizeUrl(array('Users/changePassword', 'id'=>\$data->id))",
                                //'imageUrl'=>"$add_grade_path",  // image URL of the button. If not set or false, a text link is used
                                'options' => array('class'=>'add'), // HTML options for the button
                        ),
                        ),
		),
	),
)); ?>
